//
//  MemberCampaignViewController.m
//  HomePage
//
//  Created by xiong qi on 13-5-5.
//  Copyright (c) 2013年 winston. All rights reserved.
//

#import "MemberCampaignViewController.h"

@interface MemberCampaignViewController ()

@end

@implementation MemberCampaignViewController

-(id)initWithFrame:(CGRect)frame Object:(NSObject*)obj
{
    self = [super init];
    if (self) {
        self.view.frame = frame;
        [self.view setBackgroundColor:[UIColor whiteColor]];
        NSDictionary * dic = (NSDictionary *)obj;
        
        UIImageView * background = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,1024, 768)];
        [self.view addSubview:background];
        [background release];
        [background setImage:[UIImage imageNamed:@"AllAuto_Image_BG"]];
        
        UIButton *  backBtn = [[UIButton alloc]initWithFrame:CGRectMake(10, 10, 45,45)];
        [backBtn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
        [backBtn addTarget:self action:@selector(onBack:) forControlEvents:UIControlEventTouchUpInside];
        [self.view addSubview:backBtn];
        [backBtn release];
        
        
        titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(160, 20, 400, 35)];
        titleLabel.backgroundColor = [UIColor clearColor];
        titleLabel.textAlignment = NSTextAlignmentCenter;
        titleLabel.font = [UIFont fontWithName:@"Arial" size:30];
        titleLabel.textColor = [UIColor colorWithRed:0.4 green:0.4 blue:0.4 alpha:1.0];
        [self.view addSubview:titleLabel];
        [titleLabel release];
        titleLabel.text = [dic objectForKey:@"StoreTitle"];
        
        UIImageView * lineView = [[UIImageView alloc] initWithFrame:CGRectMake((frame.size.width-658)/2,70, 658, 8)];
        lineView.image = [UIImage imageNamed:@"AllAuto_Config_TimeLine_BG"];
        [self.view addSubview:lineView];
        [lineView release];
        
        
        detailView = [[MemberCampaignView alloc] initWithFrame:CGRectMake(0, 110, frame.size.width, frame.size.height-110) Data:[dic objectForKey:@"StoreData"]];
        [self.view addSubview:detailView];
        [detailView release];
        
        
    }
    return self;
}

-(void)onBack:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}


-(void)dealloc
{
    [super dealloc];
}


@end
